package com.bianmaba.controllers.datacollection;

import com.bianmaba.spring.web.controller.CrudController;
import com.bianmaba.beans.datacollection.CollectionTask;
import com.bianmaba.commons.bean.result.OperationResult;
import com.bianmaba.commons.bean.result.QueryResult;
import com.bianmaba.commons.data.jpa.domain.request.PageableRequest;
import com.bianmaba.services.datacollection.ICollectionTaskService;
import com.bianmaba.spring.mvc.config.annotation.EntityParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
import java.util.List;

@RestController
@RequestMapping(value = "collection/task")
public class CollectionTaskController extends CrudController<CollectionTask, String> {
    @Autowired
    private ICollectionTaskService service;

    protected ICollectionTaskService getService() {
        return service;
    }

    @RequestMapping({"/query_simple"})
    public QueryResult<List<CollectionTask>> query(@EntityParam LinkedHashMap<String, Object> params, @EntityParam PageableRequest pageable) {
        return super.query(params, pageable);
    }


    @Override
    @RequestMapping({"/get_by_id"})
    public OperationResult<CollectionTask> getById(String id) {
        return super.getById(id);
    }
}
